package com.spider.test01;

public class Demo5 {
    public static void main(String[] args) {
         System.out.println(removeRepeat("abcdefghaijklaaaaamnoaaapqrstuvwxyz"));
    }
    //需求：去掉字符串中重复的字符
    public static String removeRepeat(String str){
        String newStr = "";
        for (int i = 0; i < str.length(); i++) {
            char c = str.charAt(i);
            if (!newStr.contains(c + ""))
            {
                newStr += c;
            }
        }
        return newStr;
    }
}
